package cn.yangliu.model;

import lombok.Data;

import java.io.Serializable;

/**
 * the type of serial-port-tool
 *
 * <p>
 * .
 *
 * @author 杨柳
 * @date 2024-05-28
 */
@Data
public class Result<T> implements Serializable, IResult {

    private static final long serialVersionUID = 874200365941306385L;

    /** The code. */
    private String code;

    /** The msg. */
    private String msg;

    /** The data. */
    private T data;

    public Result(IResult code) {
        this.code = code.getCode();
        this.msg = code.getMsg();
    }

    public Result(IResult code, T data) {
        this.code = code.getCode();
        this.msg = code.getMsg();
        this.data = data;
    }
}
